import { createBrowserRouter} from 'react-router-dom'
import App from '../App'


// interface typeprops{
//     path:string,
//     element:JSX.Element,
// }

const routes=createBrowserRouter([
    {
        path:'/',
        element:<App/>,
        children:[
             {
                index:true,
                lazy:async()=>{
                    const{default:Index}=await import('../page/index/Index')
                    return{
                        element:<Index/>
                    }
                }
            },
            {
                path:'index',
                lazy:async()=>{
                    const{default:Index}=await import('../page/index/Index')
                    return{
                        element:<Index/>
                    }
                }
            },
            {
                path:'order',
                lazy:async()=>{
                    const{default:Order}=await import('../page/order/Index')
                    return{
                        element:<Order/>
                    }
                }
            }
        ]
    }
])
export default routes